-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented fully lazy climate_statistics #1194
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1194 +/- ##
==========================================
- Coverage 85.51% 85.51% -0.01%
==========================================
Files 188 188
Lines 9147 9146 -1
==========================================
- Hits 7822 7821 -1
Misses 1325 1325
Continue to review full report at Codecov.
|
I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I'll have a look at improving the codecov configuration so the checks are useful, see #1195
While working on #1193 I found that the preprocessor
climate_statistics
is not lazy ifperiod='full'
and a weighted operator is used. The reason is the use ofiris.util.broadcast_to_shape
here, which broadcasts the time weights to the original shape of the cube.However, since the release of iris v3, this broadcasting is no longer necessary. PR SciTools/iris#3943 introduced the support of 1D weights for collapsing cubes. This PR implements this for our preprocessor.
Note that while our implementation might have worked previously for multidimensional time arrays, the calculation of the weights didn't make sense at all. Therefore, in this new implementation an error is raised if the time coordinate is not 1D. However, I don't even know if there is any use case for this.
I tested some recipes and all worked fine 👍 I also didn't modify the
climate_statistics
tests at all, everything worked fine with the new implementation.Closes #336.
Link to documentation:
Before you get started
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
To help with the number pull requests: